package com.edgar.action;

import com.edgar.util.WeatherReader;
import com.opensymphony.xwork2.ActionSupport;

/**
 * User: Wang Haifeng
 * Date: 12-8-29
 * Time: 上午10:37
 */
public class WeatherAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	private String msg; //返回的json串
    private String cityID;//得到的城市ＩＤ

    public String getMsg() {
        return msg;
}

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getCityID() {
        return cityID;
    }

    public void setCityID(String cityID) {
        this.cityID = cityID;
    }

    public String execute() throws Exception {
        String url = "http://www.weather.com.cn/data/cityinfo/"+getCityID()+".html";
        this.setMsg(WeatherReader.readUrl(url));
        return SUCCESS;
    }
}
